summon armor_stand ~ ~ ~ {Tags:["rmr.flying_axe", "rmr.new_entity"],Invisible:true,DisabledSlots:4194303, NoGravity:false, Invulnerable:true}
summon item_display ~ ~ ~ {Tags:["rmr.flying_axe_display", "rmr.new_entity_2"]}
$data modify storage minecraft:rmr local.x_speed set value $(x_speed)
$data modify storage minecraft:rmr local.y_speed set value $(y_speed)
$data modify storage minecraft:rmr local.z_speed set value $(z_speed)
$data modify storage minecraft:rmr local.damage set value $(damage)
execute store result score @n[tag=rmr.new_entity] rmr.entity.flying_axe.x_speed run data get storage minecraft:rmr local.x_speed 100
execute store result score @n[tag=rmr.new_entity] rmr.entity.flying_axe.y_speed run data get storage minecraft:rmr local.y_speed 100
execute store result score @n[tag=rmr.new_entity] rmr.entity.flying_axe.z_speed run data get storage minecraft:rmr local.z_speed 100
execute store result score @n[tag=rmr.new_entity] rmr.entity.flying_axe.damage run data get storage minecraft:rmr local.damage 100

data modify entity @n[tag=rmr.new_entity] CustomName set value '{"translate": "rmr.entity.flying_axe"}'
data modify entity @n[tag=rmr.new_entity_2] item set value {id:"carrot_on_a_stick", components:{custom_model_data:5257000, item_name:"{\"translate\":\"rmr.item.hatchet\"}"}}

scoreboard players set @n[tag=rmr.new_entity] rmr.entity.timer 0
scoreboard players set @n[tag=rmr.new_entity_2] rmr.entity.timer 0

execute as @n[tag=rmr.new_entity] run function rmr:connect/connect

# connect display to flying axe
tag @n[tag=rmr.new_entity] add rmr.connect.owner
execute as @n[tag=rmr.new_entity_2] run function rmr:connect/connect
tag @n[tag=rmr.new_entity] remove rmr.connect.owner
# end

data modify entity @n[tag=rmr.new_entity_2] transformation set value {right_rotation: {axis:[1, 0, 0],angle: 1.57}, left_rotation:{axis:[0, 1, 0],angle:0},scale:[1, 1, 1],translation:[0, 0, 0]}

tag @n[tag=rmr.new_entity] remove rmr.new_entity
tag @n[tag=rmr.new_entity2] remove rmr.new_entity2